.user-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding-bottom: constant(safe-area-inset-bottom);
  padding-bottom: env(safe-area-inset-bottom);
  box-sizing: border-box;
  width: 100%;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;

  // 用户信息头部
  .user-header {
    background: rgba(255, 255, 255, 0.95);
    margin: 16px 10px 10px;
    border-radius: 10px;
    padding: 14px 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    width: calc(100% - 20px);
    flex-shrink: 0;

    .user-info {
      display: flex;
      align-items: center;
      flex: 1;
      min-width: 0;

      .avatar {
        width: 54px;
        height: 54px;
        border-radius: 50%;
        margin-right: 11px;
        border: 2px solid #667eea;
        flex-shrink: 0;
      }

      .user-details {
        flex: 1;
        min-width: 0;

        .nickname {
          font-size: 18px;
          font-weight: bold;
          color: #333;
          display: block;
          margin-bottom: 4px;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
        }

        .phone {
          font-size: 15px;
          color: #666;
          display: block;
          margin-bottom: 5px;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
        }

        .level-badge {
          background: linear-gradient(45deg, #ff6b6b, #ffa500);
          padding: 3px 8px;
          border-radius: 20px;
          display: inline-block;

          .level-text {
            font-size: 12px;
            color: white;
            font-weight: bold;
          }
        }
      }
    }

    .edit-btn {
      background: #667eea;
      color: white;
      border: none;
      border-radius: 25px;
    padding: 6px 11px;
    font-size: 15px;
      font-weight: bold;
      flex-shrink: 0;
      white-space: nowrap;
    min-width: 48px;
      text-align: center;
      height: fit-content;
    }
  }

  // 功能菜单
  .menu-section {
    margin: 0 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    width: calc(100% - 40px);
    flex: 1;
    overflow-y: auto;

    .menu-item {
      display: flex;
      align-items: center;
      padding: 16px;
      border-bottom: 1px solid #f0f0f0;
      transition: background-color 0.3s ease;
      width: 100%;
      box-sizing: border-box;

      &:last-child {
        border-bottom: none;
      }

      &:active {
        background-color: #f8f9ff;
      }

      .menu-icon {
        width: 40px;
        height: 40px;
        background: linear-gradient(45deg, #667eea, #764ba2);
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 16px;
        flex-shrink: 0;

        .icon-text {
          font-size: 21px;
          color: white;
        }
        .icon-img {
          width: 21px;
          height: 21px;
        }
      }

      .menu-content {
        flex: 1;
        min-width: 0;

        .menu-title {
          font-size: 18px;
          font-weight: bold;
          color: #333;
          display: block;
          margin-bottom: 8px;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
        }

        .menu-desc {
          font-size: 15px;
          color: #666;
          display: block;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
        }
      }

      .menu-arrow {
        .arrow {
          font-size: 18px;
          color: #ccc;
          font-weight: bold;
        }
      }
    }
  }

  // 底部信息
  .footer-info {
    text-align: center;
    margin: 60px 20px 0;
    padding: 0;
    width: calc(100% - 40px);
    box-sizing: border-box;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;

    .version {
      font-size: 20px;
      color: rgba(255, 255, 255, 0.8);
      display: block;
      margin-bottom: 10px;
    }

    .copyright {
      font-size: 18px;
      color: rgba(255, 255, 255, 0.6);
      display: block;
    }
  }
}

/* 主题：深色模式覆盖 */
.user-page.theme-dark {
  background: linear-gradient(135deg, #0f172a 0%, #0b1224 100%);

  .user-header {
    background: rgba(20, 22, 35, 0.96);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);

    .user-info {
      .user-details {
        .nickname { color: #f5f7fb; }
        .phone { color: #b6c2d6; }
      }
    }

    .edit-btn { background: #5a6fd8; color: #fff; }
  }

  .menu-section {
    background: rgba(20, 22, 35, 0.96);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);

    .menu-item {
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);

      .menu-content {
        .menu-title { color: #f5f7fb; }
        .menu-desc { color: #b6c2d6; }
      }

      .menu-arrow {
        .arrow { color: #8b93a6; }
      }
    }
  }

  .footer-info {
    .version { color: rgba(255, 255, 255, 0.88); }
    .copyright { color: rgba(255, 255, 255, 0.72); }
  }
}

/* 小程序平台适配 */
/* #ifdef MP */
.user-page {
  .user-header {
    margin: 11px 8px 8px;
    padding: 14px 11px;
    box-shadow: none;
    width: calc(100% - 16px);

    .user-info {
      .avatar {
        width: 54px;
        height: 54px;
        margin-right: 11px;
      }

      .user-details {
        .nickname {
          font-size: 18px;
        }

        .phone {
          font-size: 15px;
        }

        .level-badge {
          padding: 3px 8px;

          .level-text {
            font-size: 12px;
          }
        }
      }
    }

    .edit-btn {
      padding: 6px 11px;
      font-size: 15px;
      min-width: 48px;
    }
  }
  
  .menu-section {
    margin: 0 10px;
    box-shadow: none;
    width: calc(100% - 20px);

    .menu-item {
      padding: 17px 13px;
      
      .menu-icon {
        width: 40px;
        height: 40px;
        margin-right: 13px;
        
        .icon-text {
          font-size: 21px;
        }
        .icon-img {
          width: 23px;
          height: 23px;
        }
      }
      
      .menu-content {
        .menu-title {
          font-size: 18px;
        }
        
        .menu-desc {
          font-size: 16px;
        }
      }
    }
  }

  .footer-info {
    margin: 40px 10px 0;
    padding: 0;
    width: calc(100% - 20px);

    .version {
      font-size: 22px;
    }

    .copyright {
      font-size: 20px;
    }
  }
}
/* #endif */

/* H5平台适配 */
/* #ifdef H5 */
.user-page {
  .user-header {
    .edit-btn {
      cursor: pointer;
      &:hover {
        background: #5a6fd8;
        transform: translateY(-2px);
        transition: all 0.3s ease;
      }
    }
  }
  
  .menu-item {
    cursor: pointer;
    &:hover {
      background-color: #f8f9ff;
      transform: translateX(5px);
      transition: all 0.3s ease;
    }
  }
}
/* #endif */

/* RN平台适配 */
/* #ifdef RN */
.user-page {
  .user-header {
    margin: 11px 8px 8px;
    padding: 14px 11px;
    width: calc(100% - 16px);

    .user-info {
      .avatar {
        width: 54px;
        height: 54px;
        margin-right: 11px;
      }

      .user-details {
        .nickname {
          font-size: 18px;
        }

        .phone {
          font-size: 15px;
        }

        .level-badge {
          padding: 3px 8px;

          .level-text {
            font-size: 12px;
          }
        }
      }
    }

    .edit-btn {
      padding: 6px 11px;
      font-size: 15px;
      min-width: 48px;
    }
  }
  
  .menu-section {
    margin: 0 10px;
    width: calc(100% - 20px);

    .menu-item {
      padding: 17px 13px;
      
      .menu-icon {
        width: 40px;
        height: 40px;
        margin-right: 13px;
        
        .icon-text {
          font-size: 21px;
        }
        .icon-img {
          width: 23px;
          height: 23px;
        }
      }
      
      .menu-content {
        .menu-title {
          font-size: 18px;
        }
        
        .menu-desc {
          font-size: 16px;
        }
      }
    }
  }

  .footer-info {
    margin: 40px 10px 0;
    padding: 0;
    width: calc(100% - 20px);

    .version {
      font-size: 22px;
    }

    .copyright {
      font-size: 20px;
    }
  }
}
/* #endif */

/* 大屏设备适配 */
@media screen and (min-width: 768px) {
  .user-page {
    .user-header {
      margin: 60px 100px 30px;
      padding: 50px 40px;
      width: calc(100% - 200px);

      .user-info {
        .avatar {
          width: 140px;
          height: 140px;
          margin-right: 40px;
        }

        .user-details {
          .nickname {
            font-size: 40px;
          }

          .phone {
            font-size: 32px;
          }

          .level-badge {
            padding: 10px 24px;

            .level-text {
              font-size: 26px;
            }
          }
        }
      }

      .edit-btn {
        padding: 18px 36px;
        font-size: 32px;
        min-width: 120px;
      }
    }

    .menu-section {
      margin: 0 100px;
      width: calc(100% - 200px);

      .menu-item {
        padding: 40px;

        .menu-icon {
          width: 90px;
          height: 90px;
          margin-right: 40px;

          .icon-text {
            font-size: 48px;
          }
          .icon-img {
            width: 50px;
            height: 50px;
          }
        }

        .menu-content {
          .menu-title {
            font-size: 36px;
          }

          .menu-desc {
            font-size: 28px;
          }
        }
      }
    }

    .footer-info {
      margin-top: 80px;
      padding: 0 100px;
      width: calc(100% - 200px);

      .version {
        font-size: 28px;
      }

      .copyright {
        font-size: 24px;
      }
    }
  }
}

/* 小屏设备适配 */
@media screen and (max-width: 320px) {
  .user-page {
    .user-header {
      margin: 30px 20px 20px;
      padding: 30px 20px;
      width: calc(100% - 40px);

      .user-info {
        .avatar {
          width: 100px;
          height: 100px;
          margin-right: 20px;
        }

        .user-details {
          .nickname {
            font-size: 32px;
          }

          .phone {
            font-size: 24px;
          }

          .level-badge {
            padding: 6px 16px;

            .level-text {
              font-size: 20px;
            }
          }
        }
      }

      .edit-btn {
        padding: 12px 24px;
        font-size: 24px;
        min-width: 80px;
      }
    }

    .menu-section {
      margin: 0 20px;
      width: calc(100% - 40px);

      .menu-item {
        padding: 20px;

        .menu-icon {
          width: 60px;
          height: 60px;
          margin-right: 20px;

          .icon-text {
            font-size: 32px;
          }
          .icon-img {
            width: 32px;
            height: 32px;
          }
        }

        .menu-content {
          .menu-title {
            font-size: 28px;
          }

          .menu-desc {
            font-size: 22px;
          }
        }
      }
    }

    .footer-info {
      margin-top: 40px;
      padding: 0 20px;
      width: calc(100% - 40px);

      .version {
        font-size: 20px;
      }

      .copyright {
        font-size: 18px;
      }
    }
  }
}

/* 超大屏设备适配 */
@media screen and (min-width: 1200px) {
  .user-page {
    .user-header {
      margin: 80px 150px 40px;
      padding: 60px 50px;
      width: calc(100% - 300px);

      .user-info {
        .avatar {
          width: 160px;
          height: 160px;
          margin-right: 50px;
        }

        .user-details {
          .nickname {
            font-size: 48px;
          }

          .phone {
            font-size: 36px;
          }

          .level-badge {
            padding: 12px 30px;

            .level-text {
              font-size: 28px;
            }
          }
        }
      }

      .edit-btn {
        padding: 20px 40px;
        font-size: 36px;
        min-width: 140px;
      }
    }

    .menu-section {
      margin: 0 150px;
      width: calc(100% - 300px);

      .menu-item {
        padding: 50px;

        .menu-icon {
          width: 100px;
          height: 100px;
          margin-right: 50px;

          .icon-text {
            font-size: 56px;
          }
          .icon-img {
            width: 60px;
            height: 60px;
          }
        }

        .menu-content {
          .menu-title {
            font-size: 40px;
          }

          .menu-desc {
            font-size: 32px;
          }
        }
      }
    }

    .footer-info {
      margin-top: 100px;
      padding: 0 150px;
      width: calc(100% - 300px);

      .version {
        font-size: 32px;
      }

      .copyright {
        font-size: 28px;
      }
    }
  }
}